<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>{$data.name}</title>
    <link rel="stylesheet" href="__STATIC__assets/libs/layui/css/layui.css"/>
    <link rel="stylesheet" href="__STATIC__assets/module/admin.css?v=318"/>
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    
    <style>
        #formBasForm {
            max-width: 700px;
            margin: 30px auto;
        }

        #formBasForm .layui-form-item {
            margin-bottom: 25px;
        }
        
        /** // 应用列表样式结束 */
        .alert {
            -webkit-border-radius: 2px;
            border-radius: 2px;
        }

        .alert-info {
            color: #31708f;
            background-color: #d9edf7;
            border-color: #bce8f1;
        }
        .alert-dismissable, .alert-dismissible {
            padding-right: 35px;
        }
        .alert {
                padding: 15px;
                margin-bottom: 20px;
                border: 1px solid transparent;
                border-radius: 4px;
        }
    </style>
</head>
<body>
<!-- 正文开始 -->
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-tab layui-tab-brief">
            <div class="layui-tab-content">
            <div class="alert alert-info alert-dismissible" role="alert">{$data.gogao|raw}</div>              
            <!-- 表单开始 -->
            <form class="layui-form" id="formBasForm" lay-filter="formBasForm">
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">充值商户:</label>
                    <div class="layui-input-block">
                        <input name="name" value="{$data.user}" placeholder="商户用户名" class="layui-input"
                           lay-verify="required" required disabled/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">充值余额:</label>
                    <div class="layui-input-block">
                        <input name="money" value="100" placeholder="请输入充值金额" class="layui-input"
                           lay-verify="required|numberX" required/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">充值方式:</label>
                    <div class="layui-input-block">
                        <input type="radio" name="type" value="alipay" title="支付宝" checked>
                        <input type="radio" name="type" value="weixin" title="微信" >
                        <input type="radio" name="type" value="qq" title="Q Q" >
                        <div class="layui-word-aux">充值不到账，请联系客服处理！</div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn layui-btn-primary" type="button" ew-href="{$data.web_kefu}"  ew-event="closeDialog">联系客服</button>
                        <button class="layui-btn"  lay-filter="PaySubmit" lay-submit>确认充值</button>
                    </div>
                </div>
            </form>
            <!-- //表单结束 -->
         </div> 
        </div>
    </div>
</div>

<!-- js部分 -->
<script type="text/javascript" src="__STATIC__assets/libs/layui/layui.js"></script>
<script type="text/javascript" src="__STATIC__assets/js/common.js?v=318"></script>
<script>
       layui.use(['layer', 'form', 'admin', 'formX'], function () {
           
        var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;
        var admin = layui.admin;   
        var formX = layui.formX;
        
        form.render(null, 'PayForm');
        form.on('submit(PaySubmit)', function (data) {
			var loadIndex = layer.load(2);
                $.post('chozhi', data.field, function (res) {
                    layer.close(loadIndex);
                    if (res.code==1) {                                
                        document.write(res.msg);
                        setTimeout(function () {
                            window.location.reload();
                        }, 4000);
                    } else {
                        layer.msg(res.msg, {icon: 2});
                    }
                },  'json');
                admin.closeDialog('[lay-filter="PaySubmit"]');
                return false;
               });
       });
</script>
</body>
</html>